//
//  JXNewsTableViewCell.m
//  JXAddressApp
//
//  Created by zhhw_home on 2018/10/28.
//  Copyright © 2018年 zhhw_home. All rights reserved.
//

#import "JXNewsTableViewCell.h"
#import "Masonry.h"
#import "UILabel+QMUI.h"
#import "UIColor+QMUI.h"

@implementation JXNewsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
    }
    
    return self;
}

- (void)initRootView
{
    _imgView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgView];
    
    _titleLabel = [[UILabel alloc] qmui_initWithFont:[UIFont systemFontOfSize:15] textColor:[UIColor qmui_colorWithHexString:@"#333333"]];
    _titleLabel.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:_titleLabel];
    
    _dateLabel = [[UILabel alloc] qmui_initWithFont:[UIFont systemFontOfSize:13] textColor:[UIColor qmui_colorWithHexString:@"#666666"]];
    _dateLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_dateLabel];
    
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView).offset(10);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(80);
    }];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.imgView.mas_right).offset(10);
        make.top.mas_equalTo(self.imgView.mas_top);
        make.right.mas_equalTo(self.contentView).offset(-10);
        make.bottom.mas_equalTo(self.imgView.mas_bottom).offset(-25);
    }];
    
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.imgView.mas_right).offset(10);
        make.height.mas_equalTo(20);
        make.right.mas_equalTo(self.contentView).offset(-10);
        make.bottom.mas_equalTo(self.imgView.mas_bottom);
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
